package org.jeecg.modules.hbjh.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.bocom.api.utils.ApiUtils;
import com.bocom.api.utils.enums.EncryptType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.common.util.RestUtil;
import org.jeecg.common.util.encryption.AesEncryptUtil;
import org.jeecg.modules.api.comApi.vo.GetTokenRtn;
import org.jeecg.modules.hbjh.config.BCMApiConfig;
import org.jeecg.modules.hbjh.convert.TaxRequestParamConvert;
import org.jeecg.modules.hbjh.convert.TaxResponseRtnConvert;
import org.jeecg.modules.system.service.ISysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.HashMap;

/**
 * @Description: 河北交通银行请求数据转换接口
 * @Author: jeecg-boot
 * @Date: 2023-08-02
 * @Version: V1.0
 */
@Api(tags = "河北交通银行请求数据转换")
@RestController
@RequestMapping("/convert/request/")
@Slf4j
public class HbjhRequstConvertController {

    private Boolean isJs = false;//是否调用金税接口
    private String app_key = "b5e77df78fb390dbf9a514acb59ac14d";
    private String app_secret = "a414a14b9072e41fe5e112a87a87c3b9155f9659";
    private final String tokenKey = "HBJH-TAXAPI-TOKEN";//存放在redis缓存里面的token
    @Resource
    private RedisUtil redisUtil;
    private static HbjhRequstConvertController hbjhRequstConvertController;
    /**
     * 加载容器中资源
     * 项目启动生成调用
     */
    @PostConstruct
    private void init () {
        hbjhRequstConvertController = this;
    }

    @Autowired
    private ISysDictService sysDictService;

    private static String sysDictCode="xxparams";//销项参数配置字典编码

    private static String sysDictItemKey="hbjh_prod_prefixurl";//河北交行转发地址key

    private static String prod_prefixurl = "http://8142306e1k.goho.co:25313";//转发地址

    /**
     * 从销项参数配置字典中获取实时的调用转发地址
     * @return
     */
    public static String getUrl(){
       String url=hbjhRequstConvertController.sysDictService.queryDictTextByKey(sysDictCode, sysDictItemKey);
       if(StringUtils.isNotEmpty(url)){
           prod_prefixurl=url;
       }
       log.info("转发请求地址："+prod_prefixurl);
       return  prod_prefixurl;
    }

    /**
     * 转发调用地址
     */
    public enum CONVERTURL {
        GETTOKEN("获取token", "/taxshare/api/comApi/getToken"),
        ZNFMURL("智能赋码调用地址", "/taxshare/api/xxApi/znfm"),
        TBKPURL("同步开票调用地址","/taxshare/api/xxApi/fpkj"),
        //        QDPSQURL ("全电正票申请调用地址","http://218.28.172.28:10001/api/xxgl/v3/tbkp.do"),
        QDPSQURL("全电正票申请调用地址",  "/taxshare/api/xxApi/fpkj"),
        SYNUSERURL("用户信息同步新增地址", "/taxshare/api/comApi/userSyn"),
        ZPFPHMCXURL("纸票待开号码查询", "http://218.28.172.28:10001/api/xxgl/v3/tbkp.do"),
        SDRZDQSJURL("数电认证到期时间查询", "http://218.28.172.28:10001/api/xxgl/v2/tbkp.do"),
        DJTSURL("单据推送调用地址", "http://localhost:8088/dkpdj/djtsV2"),
//        QDPSQURL ("全电正票申请调用地址","http://218.28.172.28:10001/api/xxgl/v3/tbkp.do"),

        DJTSURL_NOJS("单据推送调用地址", "/taxshare/api/xxApi/djts"),
        ZPFPHMCXURL_NOJS("纸票待开号码查询", "/taxshare/api/xxApi/currentFphm"),
        SDRZDQSJURL_NOJS("数电认证到期时间查询", "/taxshare/api/xxApi/kpzdRzdqDate");
        private final String desc;//描述
        private final String url;//url地址

        CONVERTURL(String desc, String url) {
            this.desc = desc;
            this.url = url;
        }
    }

    /**
     * 获取token接口
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-智能赋码")
    @ApiOperation(value = "河北交通银行请求数据转换-智能赋码", notes = "河北交通银行请求数据转换-智能赋码")
    public HttpHeaders getTokenHeader() {
        JSONObject params=new JSONObject();
        params.put("app_key",app_key);
        params.put("app_secret",app_secret);
        String token=null;
        token =redisUtil.get(tokenKey)!=null?String.valueOf(redisUtil.get(tokenKey)):null;
        if(StringUtils.isEmpty(token)) {
            JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.GETTOKEN.url, null, params);
            Result<JSONObject> result = rtnJson.toJavaObject(Result.class);
            if (result.isSuccess()) {
                GetTokenRtn tokenRtn=(new JSONObject(result.getResult())).toJavaObject(GetTokenRtn.class);
                token=tokenRtn.getToken();
                redisUtil.set(tokenKey,token,tokenRtn.getTokenTime()-20);
            }
        }
        //封装智能赋码调用参数
        HttpHeaders headers = RestUtil.getHeaderApplicationJson();
        headers.add(CommonConstant.X_ACCESS_TOKEN,token);
        return headers;
    }

    /**
     * 销项-智能赋码转换接口
     *
     * @param oristr
     * @param
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-智能赋码")
    @ApiOperation(value = "河北交通银行请求数据转换-智能赋码", notes = "河北交通银行请求数据转换-智能赋码")
    @PostMapping(value = "/apiAccessAcl/xxApiAccessAcl/znfmApi")
    public String znfm(@RequestBody String oristr) {
        System.out.println("河北交通银行请求数据转换-智能赋码:请求加密参数：" + oristr);
        String respMsg = null;
        try {
            //对报文进行验签解密
            HashMap<String, String> reqMap = ApiUtils.parseCommunicationJsonWithBocomSign(EncryptType.SM2_AND_SM4, oristr, BCMApiConfig.MY_PRIVATE_KEY, BCMApiConfig.APIGW_PUBLIC_KEY);
            //解密后的明文信息
            //业务区字段标识
            JSONObject content = JSONObject.parseObject(reqMap.get("biz_content"));
            System.out.println("河北交通银行请求数据转换-发票开具:请求明文参数：" + content.toJSONString());
            //签名信息
            String msg_id = reqMap.get("msg_id");
            //时间戳
            String timestamp = reqMap.get("timestamp");
            //对称密钥
            String encrypt_key = reqMap.get("encrypt_key");
//            JSONObject content = JSONObject.parseObject(oristr);

            JSONObject params = content;
            log.info("智能赋码转换参数：" + content.toJSONString());
            JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.ZNFMURL.url, getTokenHeader(), null, params);

            //返回报文
            String rspBizContent = rtnJson.toJSONString();
            log.info("智能赋码明文：" + rspBizContent);
            //对返回报文进行加密加签
            respMsg = ApiUtils.signRspBizContent(EncryptType.SM2_AND_SM4, rspBizContent, encrypt_key, BCMApiConfig.MY_PRIVATE_KEY);
//            respMsg=rspBizContent;
            log.info("智能赋码密文：" + respMsg);
        } catch (Exception e) {
            e.printStackTrace();
            return "调用异常：" + e.getMessage();
        }
        return respMsg;
    }

    /**
     * 销项-发票开具转换接口
     *
     * @param oristr
     * @param
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-发票开具")
    @ApiOperation(value = "河北交通银行请求数据转换-发票开具", notes = "河北交通银行请求数据转换-发票开具")
    @PostMapping(value = "/api/xxgl/tbkp.do")
    public String tnkp(@RequestBody String oristr) {
        System.out.println("河北交通银行请求数据转换-发票开具:请求加密参数：" + oristr);
        String respMsg = null;
        try {
            //对报文进行验签解密
            HashMap<String, String> reqMap = ApiUtils.parseCommunicationJsonWithBocomSign(EncryptType.SM2_AND_SM4, oristr, BCMApiConfig.MY_PRIVATE_KEY, BCMApiConfig.APIGW_PUBLIC_KEY);
            //解密后的明文信息
            //业务区字段标识
            JSONObject content = JSONObject.parseObject(reqMap.get("biz_content"));
            //对称密钥
            String encrypt_key = reqMap.get("encrypt_key");

            JSONObject params = content;
            System.out.println("河北交通银行请求数据转换-发票开具:请求明文参数：" + content.toJSONString());
            String rspBizContent = null;
            if (isJs) {//调用金税接口
                String param = AesEncryptUtil.encrypt(content.toJSONString(), "5hUbo4zNIisGZMtK", "5hUbo4zNIisGZMtK");
                String rtnJson = RestUtil.postStr(CONVERTURL.DJTSURL.url, null, param);
                System.out.println("金穗加密返回值：" + rtnJson);
                //返回报文
                rspBizContent = AesEncryptUtil.desEncrypt(rtnJson, "5hUbo4zNIisGZMtK", "5hUbo4zNIisGZMtK");
            } else {
                System.out.println("------------开始转换请求参数----------------");
                Result<JSONObject> convertRtn = TaxRequestParamConvert.skFpkjParamConvert(params);
                System.out.println("转换后的请求参数:" + JSONObject.toJSONString(convertRtn));
                Result<JSONObject> taxRtn = new Result<>();
                if (convertRtn.isSuccess()) {
                    JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.TBKPURL.url, getTokenHeader(), null, JSON.parseObject(JSONObject.toJSONString(convertRtn.getResult())));
                    taxRtn = rtnJson.toJavaObject(Result.class);

                } else {
                    taxRtn = Result.error(convertRtn.getMessage());
                }
                //转换返回参数
                System.out.println("转换前的返回参数:" + JSONObject.toJSONString(taxRtn));
                JSONObject jsRtn = TaxResponseRtnConvert.skfpkjRtnConvert(taxRtn);
                System.out.println("转换后的返回参数:" + jsRtn.toJSONString());
                rspBizContent = jsRtn.toJSONString();
            }
            System.out.println("河北交通银行请求数据转换-发票开具:返回明文参数：" + rspBizContent);
            //对返回报文进行加密加签
            respMsg = ApiUtils.signRspBizContent(EncryptType.SM2_AND_SM4, rspBizContent, encrypt_key, BCMApiConfig.MY_PRIVATE_KEY);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return respMsg;
    }

    /**
     * 销项-单据推送转换接口
     *
     * @param oristr
     * @param
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-单据推送")
    @ApiOperation(value = "河北交通银行请求数据转换-单据推送", notes = "河北交通银行请求数据转换-单据推送")
    @PostMapping(value = "/dkpdj/djtsV2")
    public String djts(@RequestBody String oristr) {
        System.out.println("河北交通银行请求数据转换-单据推送:请求加密参数：" + oristr);
        String respMsg = null;
        try {
            //对报文进行验签解密
            HashMap<String, String> reqMap = ApiUtils.parseCommunicationJsonWithBocomSign(EncryptType.SM2_AND_SM4, oristr, BCMApiConfig.MY_PRIVATE_KEY, BCMApiConfig.APIGW_PUBLIC_KEY);
            //解密后的明文信息
            //业务区字段标识
            JSONObject content = JSONObject.parseObject(reqMap.get("biz_content"));
            //对称密钥
            String encrypt_key = reqMap.get("encrypt_key");
            JSONObject params = content;
            System.out.println("河北交通银行请求数据转换-单据推送:请求明文参数：" + content.toJSONString());
            String rspBizContent = null;
            if (isJs) {//调用金税接口
                String param = AesEncryptUtil.encrypt(content.toJSONString(), "5hUbo4zNIisGZMtK", "5hUbo4zNIisGZMtK");
                String rtnJson = RestUtil.postStr(CONVERTURL.DJTSURL.url, null, param);
                System.out.println("金穗加密返回值：" + rtnJson);
                //返回报文
                rspBizContent = AesEncryptUtil.desEncrypt(rtnJson, "5hUbo4zNIisGZMtK", "5hUbo4zNIisGZMtK");
            } else {
                System.out.println("------------单据推送开始转换请求参数----------------");
                Result<JSONObject> convertRtn = TaxRequestParamConvert.djtsParamConvert(params);
                System.out.println("单据推送转换后的请求参数:" + JSONObject.toJSONString(convertRtn));
                Result<JSONArray> taxRtn = new Result<>();
                if (convertRtn.isSuccess()) {
                    JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.DJTSURL_NOJS.url, getTokenHeader(), null, JSON.parseObject(JSONObject.toJSONString(convertRtn.getResult())));
                    taxRtn = rtnJson.toJavaObject(Result.class);

                } else {
                    taxRtn = Result.error(convertRtn.getMessage());
                }
                //转换返回参数
                System.out.println("转换前的返回参数:" + JSONObject.toJSONString(taxRtn));
                JSONObject jsRtn = TaxResponseRtnConvert.djtsRtnConvert(taxRtn);
                System.out.println("转换后的返回参数:" + jsRtn.toJSONString());
                rspBizContent = jsRtn.toJSONString();
            }
            System.out.println("河北交通银行请求数据转换-单据推送:返回明文参数：" + rspBizContent);
            //对返回报文进行加密加签
            respMsg = ApiUtils.signRspBizContent(EncryptType.SM2_AND_SM4, rspBizContent, encrypt_key, BCMApiConfig.MY_PRIVATE_KEY);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return respMsg;
    }

    /**
     * 销项-全电正票申请转换接口
     *
     * @param oristr
     * @param
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-全电正票申请")
    @ApiOperation(value = "河北交通银行请求数据转换-全电正票申请", notes = "河北交通银行请求数据转换-全电正票申请")
    @PostMapping(value = "/api/xxgl/v3/tbkp.do")
    public String qdpsq(@RequestBody String oristr) {
        System.out.println("河北交通银行请求数据转换-全电正票申请:请求加密参数：" + oristr);
        String respMsg = null;
        try {
            //对报文进行验签解密
            HashMap<String, String> reqMap = ApiUtils.parseCommunicationJsonWithBocomSign(EncryptType.SM2_AND_SM4, oristr, BCMApiConfig.MY_PRIVATE_KEY, BCMApiConfig.APIGW_PUBLIC_KEY);
            //解密后的明文信息
            //业务区字段标识
            JSONObject content = JSONObject.parseObject(reqMap.get("biz_content"));
            //对称密钥
            String encrypt_key = reqMap.get("encrypt_key");
            System.out.println("河北交通银行请求数据转换-全电正票申请:请求明文参数：" + content.toJSONString());
            JSONObject params = content;
            String rspBizContent = null;
            if (isJs) {//调用金税接口
                String param = AesEncryptUtil.encrypt(content.toJSONString(), "5hUbo4zNIisGZMtK", "5hUbo4zNIisGZMtK");
                String rtnJson = RestUtil.postStr(CONVERTURL.QDPSQURL.url, null, param);
                System.out.println("金穗加密返回值：" + rtnJson);
                //返回报文
                rspBizContent = AesEncryptUtil.desEncrypt(rtnJson, "5hUbo4zNIisGZMtK", "5hUbo4zNIisGZMtK");
            } else {
                //数据转换
                Result convertRtn = TaxRequestParamConvert.fpkjParamConvert(params);
                String paramStr = null;
                String error = null;
                Result<JSONObject> taxRtn = new Result<>();
                if (convertRtn.isSuccess()) {
                    paramStr = (String) convertRtn.getResult();
                    JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.TBKPURL.url, getTokenHeader(), null, JSONObject.parseObject(paramStr));
                    taxRtn = rtnJson.toJavaObject(Result.class);
                } else {
                    taxRtn = Result.error(convertRtn.getMessage());
                }
                //转换返回参数
                JSONObject jsRtn = TaxResponseRtnConvert.fpkjRtnConvert(taxRtn);
                rspBizContent = jsRtn.toJSONString();
            }
            //返回报文
            System.out.println("河北交通银行请求数据转换-全电正票申请:返回明文参数：" + rspBizContent);
            //对返回报文进行加密加签
            respMsg = ApiUtils.signRspBizContent(EncryptType.SM2_AND_SM4, rspBizContent, encrypt_key, BCMApiConfig.MY_PRIVATE_KEY);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return respMsg;
    }

    /**
     * 销项-数电认证到期时间查询
     *
     * @param oristr
     * @param
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-数电认证到期时间查询")
    @ApiOperation(value = "河北交通银行请求数据转换-数电认证到期时间查询", notes = "河北交通银行请求数据转换-数电认证到期时间查询")
    @PostMapping(value = "/api/xxgl/v2/tbkp.do")
    public String sdrzdqsjcx(@RequestBody String oristr) {
        System.out.println("河北交通银行请求数据转换-数电认证到期时间查询:请求加密参数：" + oristr);
        String respMsg = null;
        try {
            //对报文进行验签解密
            HashMap<String, String> reqMap = ApiUtils.parseCommunicationJsonWithBocomSign(EncryptType.SM2_AND_SM4, oristr, BCMApiConfig.MY_PRIVATE_KEY, BCMApiConfig.APIGW_PUBLIC_KEY);
            //解密后的明文信息
            //业务区字段标识
            JSONObject content = JSONObject.parseObject(reqMap.get("biz_content"));
            //对称密钥
            String encrypt_key = reqMap.get("encrypt_key");
            System.out.println("河北交通银行请求数据转换-数电认证到期时间查询:请求明文参数：" + content.toJSONString());
            JSONObject params = content;
            //返回报文
            String rspBizContent = null;
            if (isJs) {//调用金税接口
                JSONObject rtnJson = RestUtil.post(CONVERTURL.SDRZDQSJURL.url, null, params);
                //返回报文
                rspBizContent = rtnJson.toJSONString();
            } else {
                Result<JSONObject> convertRtn = TaxRequestParamConvert.sdrzdqsjcxParamConvert(params);
                Result taxRtn = new Result<>();
                if (convertRtn.isSuccess()) {
                    JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.SDRZDQSJURL_NOJS.url, getTokenHeader(), null, convertRtn.getResult());
                    taxRtn = rtnJson.toJavaObject(Result.class);
                } else {
                    taxRtn = Result.error(convertRtn.getMessage());
                }
                //转换返回参数
                JSONObject jsRtn = TaxResponseRtnConvert.sdrzdqsjcxRtnConvert(taxRtn);
                rspBizContent = jsRtn.toJSONString();
            }
            System.out.println("河北交通银行请求数据转换-数电认证到期时间查询:返回明文参数：" + rspBizContent);
            //对返回报文进行加密加签
            respMsg = ApiUtils.signRspBizContent(EncryptType.SM2_AND_SM4, rspBizContent, encrypt_key, BCMApiConfig.MY_PRIVATE_KEY);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return respMsg;
    }

    /**
     * 销项-纸票待开号码查询
     *
     * @param oristr
     * @param
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-纸票待开号码查询")
    @ApiOperation(value = "河北交通银行请求数据转换-纸票待开号码查询", notes = "河北交通银行请求数据转换-纸票待开号码查询")
    @PostMapping(value = "//api/xxgl/v3/tbkp.do")
    public String zpfphmcx(@RequestBody String oristr) {
        System.out.println("河北交通银行请求数据转换-纸票待开号码查询:请求加密参数：" + oristr);
        String respMsg = null;
        try {
            //对报文进行验签解密
            HashMap<String, String> reqMap = ApiUtils.parseCommunicationJsonWithBocomSign(EncryptType.SM2_AND_SM4, oristr, BCMApiConfig.MY_PRIVATE_KEY, BCMApiConfig.APIGW_PUBLIC_KEY);
            //解密后的明文信息
            //业务区字段标识
            JSONObject content = JSONObject.parseObject(reqMap.get("biz_content"));
            //对称密钥
            String encrypt_key = reqMap.get("encrypt_key");
            System.out.println("河北交通银行请求数据转换-纸票待开号码查询:请求明文参数：" + content.toJSONString());
            JSONObject params = content;
            //返回报文
            String rspBizContent = null;
            if (isJs) {//调用金税接口
                JSONObject rtnJson = RestUtil.post(CONVERTURL.ZPFPHMCXURL.url, null, params);
                //返回报文
                rspBizContent = rtnJson.toJSONString();
            } else {
                Result<JSONObject> convertRtn = TaxRequestParamConvert.zpfphmcxParamConvert(params);
                Result taxRtn = new Result<>();
                if (convertRtn.isSuccess()) {
                    JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.ZPFPHMCXURL_NOJS.url, getTokenHeader(), null, convertRtn.getResult());
                    taxRtn = rtnJson.toJavaObject(Result.class);
                } else {
                    taxRtn = Result.error(convertRtn.getMessage());
                }
                //转换返回参数
                JSONObject jsRtn = TaxResponseRtnConvert.zpfphmcxRtnConvert(taxRtn);
                rspBizContent = jsRtn.toJSONString();
            }
            System.out.println("河北交通银行请求数据转换-纸票待开号码查询:返回明文参数：" + rspBizContent);
            //对返回报文进行加密加签
            respMsg = ApiUtils.signRspBizContent(EncryptType.SM2_AND_SM4, rspBizContent, encrypt_key, BCMApiConfig.MY_PRIVATE_KEY);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return respMsg;
    }

    /**
     * 用户-新增转换接口
     *
     * @param oristr
     * @param
     * @return
     */
    @AutoLog(value = "河北交通银行请求数据转换-用户-新增")
    @ApiOperation(value = "河北交通银行请求数据转换-用户-新增", notes = "河北交通银行请求数据转换-用户-新增")
    @PostMapping(value = "/apiAccessAcl/userSynApi")
    /**
     * {
     * "name":"用户名称",
     * "org_name":"所属机构名称",
     * "phone_no":"手机号",
     * "status":"状态"
     * "user_type":"用户类型"
     * }
     */
    public String userSynApi(@RequestBody String oristr) {
        System.out.println("河北交通银行请求数据转换-用户-新增:请求加密参数：" + oristr);
        String respMsg = null;
        try {
            //对报文进行验签解密
            HashMap<String, String> reqMap = ApiUtils.parseCommunicationJsonWithBocomSign(EncryptType.SM2_AND_SM4, oristr, BCMApiConfig.MY_PRIVATE_KEY, BCMApiConfig.APIGW_PUBLIC_KEY);
            //解密后的明文信息
            //业务区字段标识
            JSONObject content = JSONObject.parseObject(reqMap.get("biz_content"));
            //对称密钥
            String encrypt_key = reqMap.get("encrypt_key");
            System.out.println("河北交通银行请求数据转换-用户-新增:请求明文参数：" + content.toJSONString());

            JSONObject params = content;
            JSONObject rtnJson = RestUtil.post(getUrl()+CONVERTURL.SYNUSERURL.url, getTokenHeader(), null, params);
            //返回报文
            String rspBizContent = rtnJson.toJSONString();
            System.out.println("河北交通银行请求数据转换-用户-新增:返回明文参数：" + rspBizContent);
            //对返回报文进行加密加签
            respMsg = ApiUtils.signRspBizContent(EncryptType.SM2_AND_SM4, rspBizContent, encrypt_key, BCMApiConfig.MY_PRIVATE_KEY);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return respMsg;
    }


}
